<!--
 * @Descripttion: 
 * @Version: 
 * @Author: gaohj
 * @Date: 2022-11-08 15:21:56
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-11-08 15:26:14
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            width: 3000px;
            height: 3000px;
        }
    </style>
</head>
<body>
    <script>
        // 可视窗口的尺寸 

        // BOM  
        // window.innerWidth 
        // window.innerHeight
        // 包含滚动条在内  


        // dom

        //document.documentElement.clientWidth
        //document.documentElement.clientHeight


        console.log('BOM级别获取宽度',window.innerWidth);
        console.log('BOM级别获取高度',window.innerHeight);
        console.log('----------------------------------')

        console.log('DOM级别获取宽度',document.documentElement.clientWidth);
        console.log('DOM级别获取高度',document.documentElement.clientHeight);
        

    </script>
</body>
</html>